<template>
    <div class="isreceive" >
    <div class="head" >
          <router-link tag="span" to="/user"> <img src="../assets/img/fhui.png" alt="" /></router-link>
      <h1>待收货</h1>
      <div></div>
    </div>
     <div class="upcontent"  v-show="isreceivelist==null">
        <p>暂无商品未收货</p>
    </div>
    <div class="content">
      <div class="box" v-for="(item,index) in isreceivelist" :key="index">
        <div class="box_title">
          <h4>锤子商城</h4>
          <h6>已支付</h6>
        </div>
        <div class="box_content" >
            <div class="left">
                <div class="img">
                    <img :src="item.list.url" alt="">
                </div>
            </div>
             <div class="middle">
                <p>{{item.list.name}}</p>
                <h4>{{item.list.Description}}</h4>
             </div>
              <div class="right">
                <h6>共{{item.list.num}}件</h6>
              </div>
        </div>
        <div class="box_buttom">
            <p @click="receive(index)" v-show="!item.list.isreceive">确定收货</p>
            <p  v-show="item.list.isreceive">已收货</p>
            <p  v-show="item.list.isreceive">去评价</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    props:['updatalist'],
    data() {
        return {
            isreceivelist:null,
        }
    },
    methods: {
        //  点击收货
        receive(index){
            this.isreceivelist[index].list.isreceive=true
          
        }
    },
    created() {
        if(this.updatalist){
            // 已收货的
         console.log(this.updatalist);
          this.isreceivelist=this.updatalist.filter(function (item) {
              
            return item.list.isreceive==false&&item.list.buycheck==true&&item.list.isEvaluation==false;
         })
         console.log(this.isreceivelist);
          //  window.localStorage.setItem('receivelist',this.isreceivelist.length)
         if (this.isreceivelist.length==0) {
            this.isreceivelist=null
         }
        
        }

    },
};
</script>

<style lang="scss" scoped>
.isreceive {
  .head {
    width: 100%;
    height: 50px;
    position: fixed;
    top: 0px;
    background-color: #fff;
    z-index: 50;
    border-bottom: 1px solid #dbdbdb;
      display: flex;
      justify-content: space-between;
     span {
      display: block;
     width: 30px;
      height: 30px;
      margin: 15px 0px;
      padding-left: 20px;
      img {
        width: 20px;
      }
    }
    h1 {
      text-align: center;
      line-height: 50px;
      color: rgba(0, 0, 0, 0.6);
      font-size: 18px;
      font-weight: 700;
    }
     div{
        width: 12%;
    }
  }
   .upcontent{
    width: 100%;
    margin-top: 50px;
    height: 635px;
    background-color: #f2f2f2;
    p{ 
        padding-top: 250px;
        text-align: center;
        font-size: 30px;
        color: gray;
    }
  }
  .content {
    background-color: #f2f2f2;
    // height: 700px;
     min-height: 700px;
    overflow: hidden;
    .box {
      // margin-top: 70px;
      background-color: #fff;
      border-radius: 5px;
    //   height: 60px;
      width: 90%;
      margin: 0 auto;
      margin-top: 70px;
      .box_title {
        display: flex;
        justify-content: space-between;
        padding: 5px 10px;
        height: 20px;
        h4 {
          line-height: 20px;
          font-weight: 600;
        }
        h6 {
          line-height: 20px;
          color: red;
        }
      }
      .box_content{
        display: flex;
        margin-top: 10px;
        padding-bottom: 30px;
        padding-top: 10px;
        width: 90%;
        margin: 0 auto;
        .left{
            width: 20%;
            .img{
                width: 50px;
                height: 50px;
                img{
                    width: 50px;
                }
            }
            
        }
        .middle{
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            width: 50%;
            padding-right: 5px;
            p{
                  overflow : hidden;
             text-overflow: ellipsis;
             white-space: nowrap;
            }
            h4{
                font-size: 10px;
                color: gray;
            }
        }
        .right{
            display: flex;
        flex-direction: column;
        justify-content: center;
            // width: 20%;
        }
      }
       .box_buttom{
            display: flex;
          margin-top: 10px;
       justify-content:flex-end;
       padding: 5px 0px;
        width: 90%;
        margin: 0 auto;
        p{
            font-size: 10px;
            padding: 5px 10px;
            border-radius: 5px;
            border: 1px solid gray;
        }
      }
    }
  }
}
</style> 
